package com.ge.boot04ssm.controller;

import com.ge.boot04ssm.bean.User;
import com.ge.boot04ssm.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: SpringBoot
 * @BelongsPackage: com.ge.boot04ssm.controller
 * @Author: gejingyu
 * @Date: 2024/2/2
 * @Description:
 */

@RestController
public class UserController {

    @Autowired
    UserMapper userMapper;

    @GetMapping("/user/{id}")
    public User getUser(@PathVariable("id") Long id){
        return userMapper.getUserById(id);
    }
}
